package cn.zwk.drawing.domain.rendering.service;

import cn.zwk.drawing.domain.rendering.model.RenderResult;
import cn.zwk.drawing.domain.rendering.model.NodeGeometry;
import java.util.List;

/**
 * 渲染服务领域接口
 */
public interface RenderingDomainService {
    
    /**
     * 渲染PlantUML为SVG
     */
    RenderResult renderToSvg(String plantUmlContent);
    
    /**
     * 渲染PlantUML为SVG（异步）
     */
    String renderToSvgAsync(String plantUmlContent);
    
    /**
     * 获取异步渲染结果
     */
    RenderResult getAsyncRenderResult(String renderId);
    
    /**
     * 从SVG内容中提取节点几何信息
     */
    List<NodeGeometry> extractNodeGeometries(String svgContent);
    
    /**
     * 验证PlantUML语法
     */
    boolean validatePlantUMLSyntax(String plantUmlContent);
    
    /**
     * 生成内容哈希
     */
    String generateContentHash(String plantUmlContent);
    
    /**
     * 清理渲染缓存
     */
    void clearRenderCache();
    
    /**
     * 获取渲染服务状态
     */
    RenderServiceStatus getServiceStatus();
    
    /**
     * 渲染服务状态
     */
    enum RenderServiceStatus {
        HEALTHY("healthy", "健康"),
        DEGRADED("degraded", "降级"),
        UNAVAILABLE("unavailable", "不可用");
        
        private final String code;
        private final String description;
        
        RenderServiceStatus(String code, String description) {
            this.code = code;
            this.description = description;
        }
        
        public String getCode() { return code; }
        public String getDescription() { return description; }
    }
}